﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkInfMgr.aspx.cs" Inherits="InformationSystem.WebSite.Module.NoticeMgr.WorkInfMgr" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
        function callback() {
            parent.ResizeFrameHeight(GridPanel1.getHeight());
        }
    </script>
    <style type="text/css">
        .x-grid3-cell-inner
        {
            font-family: "segoe ui" ,tahoma, arial, sans-serif;
        }
        
        .x-grid-group-hd div
        {
            font-family: "segoe ui" ,tahoma, arial, sans-serif;
        }
        
        .x-grid3-hd-inner
        {
            font-family: "segoe ui" ,tahoma, arial, sans-serif;
            font-size: 12px;
        }
        
        .x-grid3-body .x-grid3-td-Cost
        {
            background-color: #f1f2f4;
        }
        
        .x-grid3-summary-row .x-grid3-td-Cost
        {
            background-color: #e1e2e4;
        }
        
        .total-field
        {
            background-color: #fff;
            font-weight: bold !important;
            color: #000;
            border: solid 1px silver;
            padding: 2px;
            margin-right: 5px;
        }
    </style>
    <script type="text/javascript">       
            var removeWork = function () {
                var grid = GridPanel1;
                grid.deleteSelected();
                workStore.save();
            }
            function callback() {
                parent.ResizeFrameHeight(TreePanel1.getHeight());
            }

            function linkRenderer(value, meta, record) {
                return String.format("<div style='cursor: pointer;font-size:13;' onclick='window.open(\"GetMessage.aspx?m=workinfo&id={0}\")'><a>{1}</a></div>", record.data.workinfoid, value);
            }
      
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
        <Listeners>
            <DocumentReady Fn="callback()" />
        </Listeners>
    </ext:ResourceManager>
    <table id="workT" style="vertical-align: baseline">
        <tr>
            <td>
                <ext:TreePanel ID="TreePanel1" runat="server" Width="150" Height="450" Icon="BookOpen"
                    Title="就业信息类型" AutoScroll="true">
                    <Root>
                        <ext:TreeNode Text="就业信息" Expanded="true">
                            <Nodes>
                                <ext:TreeNode NodeID="recv" Text="收到的就业信息" Icon="Report">
                                </ext:TreeNode>
                                <ext:TreeNode NodeID="sent" Text="发出的就业信息" Icon="Report">
                                </ext:TreeNode>
                            </Nodes>
                        </ext:TreeNode>                        
                    </Root>
                    <DirectEvents>
                        <Click OnEvent="NodeClick" Before=" if (node.id == 'recv' || node.id == 'sent') return true; return false;">
                            <ExtraParams>
                                <ext:Parameter Name="sid" Value="node.id" Mode="Raw">
                                </ext:Parameter>
                            </ExtraParams>
                        </Click>
                    </DirectEvents>
                </ext:TreePanel>
            </td>
            <td>
                <ext:GridPanel ID="GridPanel1" runat="server" Frame="true" StripeRows="true" Title="就业信息列表"
                    AutoExpandColumn="title" AnimCollapse="false" Icon="ApplicationViewColumns" TrackMouseOver="false"
                     Width="500" Height="450">
                    <Store>
                        <ext:Store ID="workStore" runat="server" GroupOnSort="false" GroupField="grouptip"
                            RemoteSort="true" OnBeforeRecordDeleted="BeforeRecordDeleted" OnAfterStoreChanged="AfterStoreChanged">
                            <SortInfo Direction="DESC" Field="sendtime" />
                            <Reader>
                                <ext:JsonReader IDProperty="WorkInfoID">
                                    <Fields>
                                        <ext:RecordField Name="workinfoid" Mapping="WorkInfoID" Type="Int" />
                                        <ext:RecordField Name="title" Mapping="Title" Type="String" />
                                        <ext:RecordField Name="keyword" Mapping="KeyWord" Type="String" />
                                        <ext:RecordField Name="commituserid" Mapping="CommitUserID" Type="String" />
                                        <ext:RecordField Name="commitusername" Mapping="CommitUserName" Type="String" />
                                        <ext:RecordField Name="collegeid" Mapping="CollegeID" Type="Int" />
                                        <ext:RecordField Name="gradeid" Mapping="GradeID" Type="Int" />
                                        <ext:RecordField Name="hasattachment" Mapping="HasAttachment" Type="Boolean" />
                                        <ext:RecordField Name="sendtime" Mapping="SendTime" Type="Date" />
                                        <ext:RecordField Name="grouptip" Mapping="GroupTip" Type="String" />
                                    </Fields>
                                </ext:JsonReader>
                            </Reader>
                        </ext:Store>
                    </Store>
                    <ColumnModel ID="ColumnModel1" runat="server">
                        <Columns>
                            <ext:Column DataIndex="grouptip" />
                            <ext:Column ColumnID="commitusername" Header="发布者" DataIndex="commitusername" Width="50">
                                <Renderer Fn="linkRenderer" />
                            </ext:Column>
                            <ext:Column ColumnID="title" Header="标题" DataIndex="title" Width="200">
                                <Renderer Fn="linkRenderer" />
                            </ext:Column>
                            <ext:DateColumn ColumnID="sendtime" Header="发布时间" DataIndex="sendtime" Width="60"
                                Format="yyyy/MM/dd HH:mm:ss" />
                        </Columns>
                    </ColumnModel>
                    <View>
                        <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                            ShowGroupName="false" EnableNoGroups="true" HideGroupedColumn="true">
                        </ext:GroupingView>
                    </View>
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <ext:Button ID="btnDelete" runat="server" Text="删除" Icon="Delete" ToolTip="删除选中的消息">
                                    <Listeners>
                                        <Click Fn="removeWork" />
                                    </Listeners>
                                </ext:Button>
                                <ext:ToolbarFill ID="ToolbarFill1" runat="server" ></ext:ToolbarFill>
                                <ext:Button ID="btnRefresh" runat="server" Text="刷新" Icon="Reload" ToolTip="刷新消息列表">                                    
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <SelectionModel>
                        <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server">
                        </ext:CheckboxSelectionModel>
                    </SelectionModel>
                </ext:GridPanel>
            </td>
        </tr>
    </table>
     <input type="hidden" runat="server" id="hdntype" />
    </form>
</body>
</html>
